<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of pro_m
 *
 * @author Gidaff_01
 */
class Pro_m extends Model{
    //put your code here
    function Actualite_m(){
          parent::Model();
          $this->load->database();
      }
      function count_all_pro(){
          $this->db->select();
          $this->db->from('pro');
          $this->db->where('id >', 0);
          $query = $this->db->get();
          return count($query->result_array());
      }
      function get_all_pro($per_page, $off_set){
          $this->db->select();
          $this->db->from('pro');
          $this->db->where('id >', 0);
          $this->db->limit($per_page,$off_set);
          $query = $this->db->get();
          return $query->result_array();
      }

      function delete_pro($id){
          return $this->db->delete('pro',array('id'=>$id));
      }

      function get_pro_by_id($id){
          $query=$this->db->get_where('pro',array('id'=>$id));
          return $query;
      }

      function update_pro($data,$id){
          return $this->db->update('pro',$data,array('id'=>$id));
      }

      function add_pro($data){
          return $this->db->insert('pro',$data);
      }
}
?>
